﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using ElectronicCommerce.Framework.Payment.Contract.DataContract;

namespace ElectronicCommerce.Framework.Payment.Contract.ServiceContract
{
    /// <summary>
    /// 支付业务接口
    /// </summary>
    [ServiceContract()]
    public interface IPaymentService
    {

        /// <summary>
        /// 收费
        /// </summary>
        /// <param name="chargeRequest"></param>
        [OperationContract]
        ChargeRequest Charge(ChargeRequest chargeRequest);

        /// <summary>
        /// 收费回调验证是否支付成功
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        ChargeCallbackResult ChargeCallback(ChargeCallbackRequest chargeCallbackRequest);

        /// <summary>
        /// 如果支付请求中已经给NotifyUrl赋值，则可以在接收网关的收费处理之后，对处理结果进行回应
        /// </summary>
        /// <param name="callbackResult"></param>
        [OperationContract]
        void NotifyGatewayChargeResult(ChargeCallbackResult callbackResult);

        /// <summary>
        /// 退款
        /// </summary>
        /// <param name="refundRequest"></param>
        [OperationContract]
        RefundResult Refund(RefundRequest refundRequest);
    }
}
